<template>
  <div class="m-t-15" v-for="(item, index) in cart.list" :key="item.objectId">
    <van-swipe-cell>
      <div class="flex align-center">
        <van-checkbox class="checkbox" v-model="item.ischeck"></van-checkbox>
        <van-card
          class="card"
          :num="item.n"
          :price="item.originprice"
          desc="描述信息"
          :title="item.proname"
          :thumb="item.img1"
        >
          <template #num>
            <van-stepper
              v-model="item.n"
              theme="round"
              button-size="22"
              disable-input
            />
          </template>
        </van-card>
      </div>
      <template #right>
        <van-button square text="删除" type="danger" class="delete-button" />
      </template>
    </van-swipe-cell>
  </div>
  <van-submit-bar
    class="submit-bar"
    :price="cart.cartAllInfo.checkPrice"
    button-text="提交订单"
    @submit="handleSubmit"
  >
    <van-checkbox
      v-model="cart.cartAllInfo.allCheck"
      @click="cart.cartAllCheckAction"
      >全选</van-checkbox
    >
    <!-- <template #tip>
        你的收货地址不支持配送, <span @click="onClickLink">修改地址</span>
      </template> -->
  </van-submit-bar>
</template>

<script lang="ts" setup>
import { useCart } from "../store/cart";
const cart = useCart();
const handleSubmit = () => {};
// import { ref } from "vue";
// const allCheck = ref(true);
// const handleAllCheck = ()=>{
//   cart.
// }
</script>

<style lang="scss" scoped>
.flex {
  background-color: #f7f8fa;
}
.checkbox {
  margin: 0 10px;
}
.card {
  flex: 1;
}
.submit-bar {
  bottom: 50px;
}
.delete-button {
  height: 100%;
}
</style>
